<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width:200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
		}

	</style>
		<script type="text/javascript">
		window.onload = function () {

			var box = document.getElementById('box');

			var is =true;

			function run(){

				if(is){

					box.style.background="blue";
					is= false;
				}else{

					box.style.background="red";
					is= true;
				}

			}

			var width =200;

			function getMax(){

				width+=1;

				box.style.width=width+"px";

			}

			setInterval(getMax, 10);

			// setInterval(run, 1000);
			
		}
	</script>
</head>
<body>
	<div class="box" id="box"></div>
</body>
</html>